package com.shenmazong.serverswaggerdemo2.controller;

import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: server-java-demo
 * @description: StudentController
 * @author: 亮子说编程
 * @create: 2020-10-22 18:38
 **/

@RestController
@Slf4j
@Api(tags = "接口-学生管理接口")
public class StudentController {
    @PostMapping("/addStudentUser")
    @ApiOperation(value = "添加学生", notes = "学生添加信息")
    @ApiOperationSupport(order = 1)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name="userName", value = "登录账号", dataType = "String", required=true),
            @ApiImplicitParam(name="nickName", value = "学生姓名", dataType = "String", required=true),
            @ApiImplicitParam(name="mobile", value = "学生电话", dataType = "String", required=true),
            @ApiImplicitParam(name="fee", value = "学生费用余额", dataType = "Long", required=true, example = "0")
    })
    public String addStudentUser(@RequestParam("userName") String userName,
                                         @RequestParam("nickName") String nickName,
                                         @RequestParam("mobile") String mobile,
                                         @RequestParam("fee") Long fee){
        return "addStudentUser";
    }

    @PostMapping("/delStudentUser")
    @ApiOperation(value = "删除学生", notes = "删除学生信息")
    @ApiOperationSupport(order = 1)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name="studentId", value = "学生id", dataType = "Integer", required=true)
    })
    public String delStudentUser(@RequestParam("studentId") Integer studentId){
        return "delStudentUser";
    }

    @PostMapping("/setStudentPass")
    @ApiOperation(value = "修改学生密码", notes = "修改学生密码")
    @ApiOperationSupport(order = 1)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name="studentId", value = "学生id", dataType = "int", required=true, example = "0"),
            @ApiImplicitParam(name="studentPass", value = "新密码", dataType = "String", required=true)
    })
    public String setStudentPass(@RequestParam("studentId") Integer studentId,
                                         @RequestParam("studentPass") String studentPass){
        return "setStudentPass";
    }
}
